import userStore from '@/store/userStore.ts';

// 非 hooks 用法，可以在任意地方放使用
export const canIUse = (permissions: string[]) => {
  const allPermissions = userStore.getState().permissions;
  if (!allPermissions || allPermissions.length === 0) return false;
  return permissions.every((p) => allPermissions.includes(p));
};
